package com.example.demo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * Copyfright(C),2022-2022,复兴元宇科技有限公司
 * FileName:Usr
 * Author:yz
 * Date:2022/3/14 7:32 下午
 * Description:
 * History:
 * <author>  <time> <version> <desc>
 * 作者       时间    版本      描述
 */
@Data
public class Usr implements Serializable {
    private Long id;

    @NotBlank(message = "用户名不能为空")
    @Length(min = 5, max = 20, message = "用户名长度为5-20个字符")
    private String name;

    @NotNull(message = "年龄不能为空")
    @Min(value = 18, message = "最小18岁")
    @Max(value = 60, message = "最大60岁")
    private Integer age;

    @Email(message = "请输入邮箱")
    @NotBlank(message = "邮箱不能为空")
    private String email;

    @MyCustomConstraint
    private String answer;


}
